var Home=({
	queryHouseList:function(){
		var search = $("#search").val();
		$.ajax({
			type : "POST",
			dataType : 'json',
			url :  "../house/queryHouseList.do",
			data : {
				"search":search
			},
			success : function(data) {
				var html ="";
				if(data.rows.length>0){
					$(data.rows).each(function(i,n){
					html+="<li>";
					html+="<li id='"+n.houseId+"'>"+
					"<img class='tuijian_house_content_img' src='../images/houseLogo/"+n.imgUrl+"'>"+

					"<div class='house_title tit_top'>"+(n.houseName.length>25?(n.houseName.substring(0,25)+"..."):n.houseName)+"</div>"+
					"<div class='house_title house_price'><span class='house_size'>"+n.houseSize+"平方</span><span class='house_type'>"+(n.layout==undefined?"暂无房型":n.layout)+"</span><span class='price' style='    float: right;    margin-right: 25px;'>"+n.price+"元/月</span></div>"+
					"<div class='house_title house_address'><span class='jiaotong'><img src='"+path+"/images/postion.png' class='position'>距离"+n.location+n.distance+"米</span> </div></li>";

					
					})
					$(".house_ul").append(html);
				}else{
					mui.toast("加载完毕");
					offset = offset-limit;
					if($(".house_ul").children().length==0){
						$(".house_ul").html("<li>抱歉！暂无数据</li>");
					}
				}
			}
		});
	},
	queryGoodHouseList:function(){
		$.ajax({
			type : "POST",
			dataType : 'json',
			url :"../house/queryHouseList.do",
			data : {
				"offset": 0,
				"limit": 5,
				"grade":1,
				"orderBy":"h.createTime desc",
			},
			success : function(data) {
				var html ="";
				if(data.rows.length>0){
					$(data.rows).each(function(i,n){
					html+="<li id='"+n.houseId+"'>"+
					"<img class='tuijian_house_content_img' src='../images/houseLogo/"+n.imgUrl+"'>"+
					"<div class='house_title tit_top'>"+(n.houseName.length>25?(n.houseName.substring(0,25)+"..."):n.houseName)+"</div>"+
					"<div class='house_title house_price'><span class='house_size'>"+n.houseSize+"平方</span><span class='house_type'>"+(n.layout==undefined?"暂无房型":n.layout)+"</span><span class='price' style='    float: right;    margin-right: 25px;'>"+n.price+"元/月</span></div>"+
					"<div class='house_title house_address'><span class='jiaotong'><img src='"+path+"/images/postion.png' class='position'>距离"+n.location+n.distance+"米</span> </div></li>";
					
					})
					$(".ghouse").append(html);
				}else{
					mui.toast("加载完毕");
					offset = offset-limit;
					if($(".ghouse").children().length==0){
						$(".ghouse").html("<li>抱歉！暂无数据</li>");
					}
				}
			}
		});
	}
})